//**********权限表***********/;
import request from '@/utils/request.js';

/**
 * 保存
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 
 *  actions:'', // 	类型:array 非必填
 *  appId:'', //$column.comments 	类型:integer 非必填
 *  children:'', // 	类型:array 非必填
 *  component:'', //路由-组件 	类型:string 非必填
 *  deleted:'', //0:未删除 1：删除 	类型:integer 非必填
 *  description:'', //描述 	类型:string 非必填
 *  hideChildrenInMenu:'', //$column.comments 	类型:boolean 非必填
 *  id:'', //$column.comments 	类型:integer 非必填
 *  meta:'', //路由-json对象，存储 title permission(name) icon keepAlive:false hideHeader: false 	类型:string 非必填
 *  name:'', //路由-名称 	类型:string 非必填
 *  parentId:'', //父节点id 	类型:integer 非必填
 *  parentIds:'', //父节点集合 	类型:string 非必填
 *  path:'', //路由-跳转路径 	类型:string 非必填
 *  redirect:'', //路由-重定向 	类型:string 非必填
 *  serialNum:'', //排列序号 	类型:integer 非必填
 *  status:'', // 1：在用  2：禁用 	类型:integer 非必填
 *  title:'', //名称 	类型:string 非必填
 *  uniqueCode:'', //唯一识别码,用于和component_router表中的name进行关联 	类型:string 非必填
 * @returns
 * ********
 */
export function postHmperm(data={}, config={}){
  return request({
    method: 'post',
    data,
    url: `/api/hmperm`,
    ...config,
  }) 
}

/**
 * 修改
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 
 *  actions:'', // 	类型:array 非必填
 *  description:'', // 	类型:string 非必填
 *  id:'', // 	类型:integer 非必填
 *  status:'', // 	类型:integer 非必填
 *  title:'', // 	类型:string 非必填
 * @returns
 * ********
 */
export function putHmperm(data={}, config={}){
  return request({
    method: 'put',
    data,
    url: `/api/hmperm`,
    ...config,
  }) 
}

/**
 * 删除
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 // 类型 array
 * []integer
 * @returns
 * ********
 */
export function deleteHmperm(data=[], config={}){
  return request({
    method: 'delete',
    data,
    url: `/api/hmperm`,
    ...config,
  }) 
}

/**
 * 获取当前用户所有菜单
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * appId:'', //appId 必填
 * userId:'', //userId 必填
 * @returns
 * ********
 */
export function getHmpermActionList(params={}, config={}){
  return request({
    method: 'get',
    params,
    url: `/api/hmperm/action/list`,
    ...config,
  }) 
}

/**
 * 详情
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * id:'', //id 必填
 * @returns
 * ********
 */
export function getHmpermInfo(params={}, config={}){
  return request({
    method: 'get',
    params,
    url: `/api/hmperm/info`,
    ...config,
  }) 
}

/**
 * 获取所有菜单
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * appId:'', //appId 必填
 * status:'', //status 非必填
 * @returns
 * ********
 */
export function getHmpermList(params={}, config={}){
  return request({
    method: 'get',
    params,
    url: `/api/hmperm/list`,
    ...config,
  }) 
}

/**
 * 分页列表
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * pageNo:'', //页码 非必填
 * pageSize:'', //每页数据条数 非必填
 * @returns
 * ********
 */
export function getHmpermPageList(params={}, config={}){
  return request({
    method: 'get',
    params,
    url: `/api/hmperm/page/list`,
    ...config,
  }) 
}

/**
 * 修改菜单动作
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 
 *  actions:'', // 	类型:array 非必填
 *  description:'', // 	类型:string 非必填
 *  id:'', // 	类型:integer 非必填
 *  status:'', // 	类型:integer 非必填
 *  title:'', // 	类型:string 非必填
 * @returns
 * ********
 */
export function putHmpermUpdatePermAndAction(data={}, config={}){
  return request({
    method: 'put',
    data,
    url: `/api/hmperm/updatePermAndAction`,
    ...config,
  }) 
}

/**
 * 启用/禁用权限
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 
 *  actions:'', // 	类型:array 非必填
 *  description:'', // 	类型:string 非必填
 *  id:'', // 	类型:integer 非必填
 *  status:'', // 	类型:integer 非必填
 *  title:'', // 	类型:string 非必填
 * @returns
 * ********
 */
export function putHmpermUpdatePermStatus(data={}, config={}){
  return request({
    method: 'put',
    data,
    url: `/api/hmperm/updatePermStatus`,
    ...config,
  }) 
}

/**
 * 表单字段验证
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * id:'', //id 必填
 * appId:'', //appId 必填
 * key:'', //key 必填
 * value:'', //value 必填
 * parentId:'', //parentId 必填
 * @returns
 * ********
 */
export function getHmpermValidatefield(params={}, config={}){
  return request({
    method: 'get',
    params,
    url: `/api/hmperm/validate-field`,
    ...config,
  }) 
}